/*
 * JOY电子商务网运营事业部
 * 中国移动通信集团设计院有限公司
 * B2BJOY.COM  OPERATION  DIVISION
 * China Mobile Group Design Institute Co., Ltd
 */

package com.uhaou.system.model;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import com.uhaou.common.base.BaseEntity;

import cn.org.rapid_framework.util.DateConvertUtils;
 

/**
 * @author  jiangcheng
 * @version 1.0
 * @since 1.0
 */


public class SysDict extends BaseEntity implements java.io.Serializable {
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "字典管理";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_PARENT_ID = "父字典";
	public static final String ALIAS_DICT_NAME = "字典名称";
	public static final String ALIAS_DICT_VALUE = "字典值";
	public static final String ALIAS_DICT_CODE = "字典编码"; 
	public static final String ALIAS_DICT_TYPE = "字典类型";
	public static final String ALIAS_DICT_DESC = "描述";
	public static final String ALIAS_CREATOR = "创建人";
	public static final String ALIAS_CREATE_TIME="创建时间";
	public static final String ALIAS_PRIORS="排序";
	public static final String ALIAS_DELETED = "deleted";
	
	public static final String FORMAT_CREATE_TIME = DATE_TIME_FORMAT;
	
	//date formats
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	@NotBlank @Length(max=32)
	private java.lang.String id;
	@Length(max=32)
	private java.lang.String parentId;
	@Length(max=50)
	private java.lang.String dictName;
	@Length(max=32)
	private java.lang.String dictValue;
	@Length(max=32)
	private java.lang.String dictCode; 
	@Length(max=32)
	private java.lang.String dictType;
	@Length(max=200)
	private java.lang.String dictDesc;
	@Length(max=32)
	private java.lang.String creator;
	@Length(max=1)
	private java.lang.String deleted;
	private java.util.Date createTime;
	private java.lang.Integer priors;
	//columns END

	public SysDict(){
	}

	public SysDict(
		java.lang.String id
	){
		this.id = id;
	}

	public void setId(java.lang.String value) {
		this.id = value;
	}
	
	public java.lang.String getId() {
		return this.id;
	}
	public void setParentId(java.lang.String value) {
		this.parentId = value;
	}
	
	public java.lang.String getParentId() {
		return this.parentId;
	}
	public void setDictName(java.lang.String value) {
		this.dictName = value;
	}
	
	public java.lang.String getDictName() {
		return this.dictName;
	}
	public void setDictValue(java.lang.String value) {
		this.dictValue = value;
	}
	
	public java.lang.String getDictValue() {
		return this.dictValue;
	}
	public void setDictCode(java.lang.String value) {
		this.dictCode = value;
	}
	
	public java.lang.String getDictCode() {
		return this.dictCode;
	}
	public void setDictType(java.lang.String value) {
		this.dictType = value;
	}
	
	public java.lang.String getDictType() {
		return this.dictType;
	}
	public void setDictDesc(java.lang.String value) {
		this.dictDesc = value;
	}
	
	public java.lang.String getDictDesc() {
		return this.dictDesc;
	}
	public void setCreator(java.lang.String value) {
		this.creator = value;
	}
	
	public java.lang.String getCreator() {
		return this.creator;
	}
	public void setDeleted(java.lang.String value) {
		this.deleted = value;
	}
	
	public java.lang.String getDeleted() {
		return this.deleted;
	}
	
	public String getCreateTimeString() {
		return DateConvertUtils.format(getCreateTime(), FORMAT_CREATE_TIME);
	}
	public void setCreateTimeString(String value) {
		setCreateTime(DateConvertUtils.parse(value, FORMAT_CREATE_TIME,java.util.Date.class));
	}
	
	public void setCreateTime(java.util.Date value) {
		this.createTime = value;
	}
	
	public java.util.Date getCreateTime() {
		return this.createTime;
	}
 

	public java.lang.Integer getPriors() {
		return priors;
	}

	public void setPriors(java.lang.Integer priors) {
		this.priors = priors;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("ParentId",getParentId())
			.append("DictName",getDictName())
			.append("DictValue",getDictValue())
			.append("DictCode",getDictCode()) 
			.append("DictType",getDictType())
			.append("DictDesc",getDictDesc())
			.append("Creator",getCreator())
			.append("Deleted",getDeleted())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof SysDict == false) return false;
		if(this == obj) return true;
		SysDict other = (SysDict)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

